package com.mbc.controller;

import com.mbc.comment.Result;
import com.mbc.pojo.MbcSign;
import com.mbc.service.MapService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 地图控制器
 *
 * @author suimeng
 * @date 2024/04/08
 */
@CrossOrigin
@RestController
@RequestMapping("/map")
@Slf4j
@Api("地图打表接口")
public class MapController {

    @Autowired
    private MapService mapService;

    /**
     * 地图坐标
     *
     * @param signId 签名 ID
     * @return {@link Result}<{@link MbcSign}>
     */
    @GetMapping("/Coordinates/{signId}")
    @ApiOperation("地图坐标")
    public Result<MbcSign> mapCoordinates(@PathVariable String signId) {
        MbcSign mbcSign = mapService.getByUserId(signId);
        return Result.success(mbcSign);
    }
}
